<template>
  <div>
    <div class="header">
      <div class="logo">
        <img src="../assets/logo.png" alt="" />
        <!-- <span class="ocr">OCR智能识别</span> -->
        <router-link to="/" class="ocr">OCR智能识别</router-link>
      </div>
      <div class="headerTab">
        <span
          v-for="(item, i) in navData"
          :class="{ activecls: active === i }"
          :key="i"
          @click="goDemo(item.type), (active = i)"
          >{{ item.name }}</span
        >
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: "Header",
  data() {
    return {
      active: -1,
      navData: [
        { name: "通用文本识别", path: "/demo", type: 1 },
        { name: "通用票据识别", path: "/demo", type: 2 },
        { name: "通用证件识别", path: "/demo", type: 3 },
        { name: "自定义识别", path: "/demo", type: 4 },
        { name: "解决方案", path: "/demo", type: 5 },
        { name: "联系我们", path: "/demo", type: 6 },
      ],
    };
  },
  methods: {
    goDemo: function (type) {
      this.$router.push({ path: "/demo", query: { type } });
    },
  },
};
</script>
<style scoped>
.activecls {
  color: #0039ff !important;
}
.unActive {
  color: #3d3d3d;
}
.root {
  background-color: #f0f6fe;
  height: 100vh;
}
.header {
  height: 56px;
  line-height: 56px;
  text-align: center;
  border-bottom: #d0d4e4 solid 1px;
  font-family: HelveticaNeue;
  font-weight: normal;
  letter-spacing: 0.02px;
  background-color: #fff;
}
.header > img {
  margin-left: 100px;
}

.headerTab > span {
  font-size: 18px;
  margin-left: 56px;
  color: rgba(0, 12, 53, 0.7);
  cursor: pointer;
}
.headerTab > span:first-child {
  margin-left: 0;
}
.logo {
  position: absolute;
  left: 5%;
  height: 56px;
  display: flex;
  align-items: center;
}
.logo > img {
  /* img_logo */
  width: 48px;
  height: 48px;
}
.ocr {
  /* OCR智能识别 */
  font-size: 18px;
  color: #3d3d3d;
  text-decoration: none;
}
</style>